<#include "admin/home.html"/>
<#macro main>
    <h3 class="field-title">新增问题</h3>
    <div class="m-form">
        <form id="dataForm">
            <div class="formitm">
                <label class="lab">问题：</label>
                <div class="ipt">
                    <input type="text" name="content" placeholder="请输入问题" required/>
                </div>
            </div>
            <div class="formitm">
                <label class="lab">答案解说：</label>
                <div class="ipt">
                    <input type="text" name="narrate" placeholder="请输入答案解说" required/>
                </div>
            </div>
            <div class="formitm">
                <label class="lab">启用：</label>
                <div class="ipt">
                    <label class="iSwitch">
                        <input type="checkbox" name="enabled" checked="checked" value="1">
                        <i></i>
                    </label>
                </div>
            </div>
            <div class="formitm ans">
                <label class="lab">答项：</label>
                <div class="ipt">
                    <input type="text" class="options" name="options0" placeholder="请输入答项" required/>
                    <label class="iSwitch">
                        <input type="radio" name="correct"/>
                        <i></i>
                    </label>
                    <img src="${resCtx}/images/admin/ico-add.png" class="add" onclick="addItem(this)"/>
                </div>
            </div>
            <div class="formitm formitm-1">
                <span class="btn" onclick="doSubmit()">提交</span>
            </div>
        </form>
    </div>

    <div id="item-tpl" style="display: none">
        <div class="formitm ans">
            <label class="lab">答项：</label>
            <div class="ipt">
                <input type="text" class="options" name="options" placeholder="请输入答项" required/>
                <label class="iSwitch">
                    <input type="radio" name="correct" />
                    <i></i>
                </label>
                <img src="${resCtx}/images/admin/ico-add.png" class="add" onclick="addItem(this)"/>
                <img src="${resCtx}/images/admin/ico-sub.png" class="rem" onclick="removeItem(this)"/>
            </div>
        </div>
    </div>
</#macro>

<#macro tplJs>
    <script type="text/javascript" src="${resCtx}/js/admin/question.js"></script>
</#macro>